package 美团;

public class _29_两数相除 {
    public int divide(int dividend, int divisor) {
        int count = 1;
        boolean isfei = true;
        if (dividend >= 0 && divisor >= 0) isfei = false;
        if (dividend >= 0 && divisor >= 0) isfei = false;
        int temp = Math.abs(divisor);
        int temp2 = Math.abs(divisor);
        while (Math.abs(temp2) <= (Math.abs(dividend) - temp)) {
            count++;
            temp2 += temp;
        }
        return isfei ? -(count) : count;
    }
}
